Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: we can now create junctions on Windows #1804

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

quintesse
Copy link
Contributor

Fixes #1793

build.gradle Outdated Show resolved Hide resolved
@quintesse
Copy link
Contributor Author

Updated PR with simplified code using cmd /c mklink /j .... to create junctions.

The createLink() will now also automatically distinguish between links to files and directories and use junctions for directories on Windows, while still using sym links for files (and possibly failing and explaining the user what to do to fix it).

@quintesse quintesse force-pushed the fix_1793 branch 5 times, most recently from dd329c3 to f95ade4 Compare June 7, 2024 00:18
On Windows it was possible to leave a JDK in a broken state by changing the default JDK
Checking for Developer Mode when it's only necessary for the `edit` command will only bother users, best to only give the warning when actually needed
@jcrben
Copy link

jcrben commented Sep 8, 2024

@quintesse @maxandersen thoughts on merging this?

@maxandersen
Copy link
Collaborator

@quintesse didnt we have some concern with this ?

I can definitely give it a go again but feel like there was still a higher permission level needed still or was that fixed?

@quintesse
Copy link
Contributor Author

quintesse commented Sep 10, 2024

@maxandersen no, on Windows it will use an external command (that should exist on all modern Windows versions) that needs no extra privileges to create a junction when dealing with links to folders. Only when we use links to files (as for the edit command) will we fall back to creating symbolic links which still need the same privileges as before. So worst case it does the same as what JBang does right now.

@maxandersen maxandersen merged commit 5e986ab into jbangdev:main Sep 12, 2024
11 checks passed
@quintesse quintesse deleted the fix_1793 branch September 12, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jbang jdk default <version> fails on Windows
3 participants